import { baseUrl } from '../service/index.js'
import httpHelper from '../utils/helper/httpHelper.js'


// 地址管理
export const Address = {
  // 发货地址列表
  deliverList(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'address/deliver/list',
        method: 'POST',
        params: params,
        successFun: successFun
      },
      scope
    )
  },
  // 发货地址数量
  deliverCount(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'address/deliver/count',
        method: 'POST',
        params: params,
        successFun: successFun
      },
      scope
    )
  },
  // 发货地址删除
  deliverDelete(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'address/deliver/delete/' + params,
        method: 'POST',
        successFun: successFun
      },
      scope
    )
  },
  // 发货地址信息
  deliverInfo(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'address/deliver/info/' + params,
        method: 'POST',
        successFun: successFun
      },
      scope
    )
  },
  // 发货地址保存
  deliverSave(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'address/deliver/save',
        method: 'POST',
        params: params,
        successFun: successFun
      },
      scope
    )
  },
  // 设置默认
  deliverSet(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'address/deliver/setDefaultUse/' + params,
        method: 'POST',
        successFun: successFun
      },
      scope
    )
  },
  // 收货地址列表
  recipientList(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'address/recipient/list',
        method: 'POST',
        params: params,
        successFun: successFun
      },
      scope
    )
  },
  // 收货地址数量
  recipientCount(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'address/recipient/count',
        method: 'POST',
        params: params,
        successFun: successFun
      },
      scope
    )
  },
  // 收货地址删除
  recipientDelete(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'address/recipient/delete/' + params,
        method: 'POST',
        successFun: successFun
      },
      scope
    )
  },
  // 收货地址信息
  recipientInfo(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'address/recipient/info/' + params,
        method: 'POST',
        successFun: successFun
      },
      scope
    )
  },
  // 收货地址保存
  recipientSave(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'address/recipient/save',
        method: 'POST',
        params: params,
        successFun: successFun
      },
      scope
    )
  },
  // 设置默认
  recipientSet(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'address/recipient/setDefaultUse/' + params,
        method: 'POST',
        successFun: successFun
      },
      scope
    )
  }
}
// 联系人管理
export const Contacts = {
  // 联系人列表
  contactsList(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'Contacts/list',
        method: 'POST',
        params: params,
        successFun: successFun
      },
      scope
    )
  },
  // 联系人数量
  contactsCount(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'Contacts/count',
        method: 'POST',
        params: params,
        successFun: successFun
      },
      scope
    )
  },
  // 联系人删除
  contactsDelete(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'Contacts/delete/' + params,
        method: 'POST',
        successFun: successFun
      },
      scope
    )
  },
  // 联系人信息
  contactsInfo(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'Contacts/info/' + params,
        method: 'POST',
        successFun: successFun
      },
      scope
    )
  },
  // 联系人保存
  contactsSave(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'Contacts/save',
        method: 'POST',
        params: params,
        successFun: successFun
      },
      scope
    )
  },
  // 设置默认
  contactsSet(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'Contacts/setDefaultUse/' + params,
        method: 'POST',
        successFun: successFun
      },
      scope
    )
  }
}
// 文件
export const File = {
  // 下载文件
  downLoadFile(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'file/downLoadFile',
        method: 'POST',
        params: params,
        successFun: successFun
      },
      scope
    )
  },
  // 获取文件
  getFile(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'file/getFile/' + params,
        method: 'POST',
        successFun: successFun
      },
      scope
    )
  },
  // 上传文件
  upLoadFile(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'file/upLoadFile',
        method: 'POST',
        params: params,
        successFun: successFun
      },
      scope
    )
  }
}
// 首页
export const Index = {
  getList(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'index/serviceCategoryList',
        method: 'POST',
        params: params,
        successFun: successFun
      },
      scope
    )
  }
}
// 订单管理
export const Order = {
  // 列表
  getList(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'order/list',
        method: 'POST',
        params: params,
        successFun: successFun
      },
      scope
    )
  },
  // 数量
  getCount(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'order/count',
        method: 'POST',
        params: params,
        successFun: successFun
      },
      scope
    )
  },
  // 支付单支付
  billPay(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'order/billPay/' + params,
        method: 'POST',
        successFun: successFun
      },
      scope
    )
  },
  // 订单信息
  getInfo(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'order/info/' + params,
        method: 'POST',
        successFun: successFun
      },
      scope
    )
  },
  // 订单发货信息
  deliverInfo(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'order/info/deliver/' + params,
        method: 'POST',
        successFun: successFun
      },
      scope
    )
  },
  // 增值信息
  extraInfo(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'order/info/extra/' + params,
        method: 'POST',
        successFun: successFun
      },
      scope
    )
  },
  // 文件信息
  fileInfo(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'order/info/file/' + params,
        method: 'POST',
        successFun: successFun
      },
      scope
    )
  },
  // 支付信息
  outlayInfo(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'order/info/outlay/' + params,
        method: 'POST',
        successFun: successFun
      },
      scope
    )
  },
  // 问题单信息
  problem(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'order/info/problem/' + params,
        method: 'POST',
        successFun: successFun
      },
      scope
    )
  },
  // 订单进度信息
  process(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'order/info/process/' + params,
        method: 'POST',
        successFun: successFun
      },
      scope
    )
  },
  // 收件人信息
  recipient(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'order/info/recipient/' + params,
        method: 'POST',
        successFun: successFun
      },
      scope
    )
  },
  // 维修信息
  repair(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'order/info/repair/' + params,
        method: 'POST',
        successFun: successFun
      },
      scope
    )
  },
  // 订单取消
  orderCancel(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'order/orderCancel/' + params,
        method: 'POST',
        successFun: successFun
      },
      scope
    )
  },
  // 订单确认收货
  confirmReceipt(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'order/orderConfirmReceipt/' + params,
        method: 'POST',
        successFun: successFun
      },
      scope
    )
  },
  // 订单支付
  orderPay(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'order/orderPay/' + params,
        method: 'POST',
        successFun: successFun
      },
      scope
    )
  }
}
// 下单
export const PlaceOrder = {
  // 计算维修金额
  calculateRepairPrice(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'placeOrder/calculateRepairPrice',
        method: 'POST',
        params: params,
        successFun: successFun
      },
      scope
    )
  },
  // 联系人列表
  contactsList(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'placeOrder/contactsList',
        method: 'POST',
        params: params,
        successFun: successFun
      },
      scope
    )
  },
  // 联系人列表数量
  contactsCount(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'placeOrder/contactsCount',
        method: 'POST',
        params: params,
        successFun: successFun
      },
      scope
    )
  },
  // 发货地址列表
  deliverList(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'placeOrder/deliverList',
        method: 'POST',
        params: params,
        successFun: successFun
      },
      scope
    )
  },
  // 发货地址列表数量
  deliverCount(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'placeOrder/deliverCount',
        method: 'POST',
        params: params,
        successFun: successFun
      },
      scope
    )
  },
  // 收货地址列表
  recipientList(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'placeOrder/recipientList',
        method: 'POST',
        params: params,
        successFun: successFun
      },
      scope
    )
  },
  // 收货地址列表数量
  recipientCount(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'placeOrder/recipientCount',
        method: 'POST',
        params: params,
        successFun: successFun
      },
      scope
    )
  },
  // 故障列表
  faultList(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'placeOrder/faultList/' + params,
        method: 'POST',
        successFun: successFun
      },
      scope
    )
  },
  // 维修时间
  repairHourList(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'placeOrder/repairHourList/' + params,
        method: 'POST',
        successFun: successFun
      },
      scope
    )
  },
  // 分类信息
  serviceCategoryInfo(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'placeOrder/serviceCategoryInfo/' + params,
        method: 'POST',
        successFun: successFun
      },
      scope
    )
  },
  // 订单保存
  saveOrder(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'placeOrder/saveOrder',
        method: 'POST',
        params: params,
        successFun: successFun
      },
      scope
    )
  },
  // 增值服务列表
  servieApplyList(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'placeOrder/servieApplyList',
        method: 'POST',
        params: params,
        successFun: successFun
      },
      scope
    )
  },
  // 订单提交
  submitOrder(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'placeOrder/submitOrder',
        method: 'POST',
        params: params,
        successFun: successFun
      },
      scope
    )
  },
  // 账户余额
  userBalance(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'placeOrder/userBalance',
        method: 'POST',
        params: params,
        successFun: successFun
      },
      scope
    )
  }
}
// 用户账户
export const User = {
  // 用户信息
  getInfo(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'user/info',
        method: 'POST',
        params: params,
        successFun: successFun
      },
      scope
    )
  },
  // 账户记录
  assetLogList(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'user/assetLogList',
        method: 'POST',
        params: params,
        successFun: successFun
      },
      scope
    )
  },
  // 账户记录数量
  assetLogCount(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'user/assetLogCount',
        method: 'POST',
        params: params,
        successFun: successFun
      },
      scope
    )
  },
  // 账户充值
  recharge(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'user/recharge',
        method: 'POST',
        params: params,
        successFun: successFun
      },
      scope
    )
  },
  // 账户信息修改
  update(params, successFun, scope) {
    return httpHelper.request(
      {
        url: baseUrl + 'user/update',
        method: 'POST',
        params: params,
        successFun: successFun
      },
      scope
    )
  }
}